<template>
    <div>
        <header><h1 class="title">{{countyTitle}}</h1></header>
        <div  class="content-box">
            <aside class="left">
                <farming :current="current"></farming>
                <food :current="current"></food>
                <distributor :current="current"></distributor>
            </aside>
            <aside class="right">
                <supply :current="current"></supply>
                <farmRatio :current="current"></farmRatio>
                <cooperative :current="current"></cooperative>
            </aside>
            <section>
                <div class="total-box">
                    <total></total>
                </div>
                <div class="map-bd">
                    <!--<img :src="mapbg">-->
                    <!--<component @changeData="changeData" :is="currentMapComponent"></component>-->
                    <countymap></countymap>
                </div>
                <div class="bottom">
                    <countyBottom :countyTitle="countyTitle"></countyBottom>
                </div>
            </section>
        </div>
    </div>
</template>
<script>
    import farming from '@/components/farming'  //农业数据统计
    import food from '@/components/food'        //食谱食材用量统计
    import distributor from '@/components/distributor'  //本年全省交易曲线图
    import supply from '@/components/supply'       //各地区各分类交易额统计图
    import cooperative from '@/components/cooperative'   //各区县校企农数据统计
    import total from '@/components/total'   //总金额，年、月、日
    import countymap from '@/components/countymap'   //县级百度地图
    import countyBottom from '@/components/countyBottom'   //底部
    import farmRatio from '@/components/farmRatio'   //底部

    export default {
        name:'countyView',
        components: {
            farming,
            food,
            distributor,
            supply,
            cooperative,
            total,
            countyBottom,
            farmRatio,
            countymap
        },
        props: {
        },
        data () {
            return {
                currentMapComponent:'',
                countyTitle:'',
                current:''
            }
        },
        computed: {
        },
        methods: {
            changeData(e){
                this.countyTitle=e;
                console.log(this.bottomTitle)
            },
            init(){
                let ID= this.$route.query.id.toString();
                this.$store.state.currentCounty=ID
                this.current=this.$store.state.currentCounty
                switch (ID){
                    case 'za':
                        this.countyTitle='正安县农产品产销对接服务智慧云大数据平台';
                        break;
                    case 'rhs':
                        this.countyTitle='仁怀市农产品产销对接服务智慧云大数据平台';
                        break;
                }
//                console.log(this.$store.currentCounty)
            }
        },
        mounted () {
        },
        created(){
            this.init()
        },
        beforeDestroy(){
            this.$store.state.currentCounty='zy';
        }
    }

</script>
<style type="text/css">
</style>